//
// CWaterShape.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CRGBA;
import org.ryzom.nel.misc.IStream;

public class CWaterShape extends IShape {
  private long swigCPtr;

  public CWaterShape(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CWaterShape_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CWaterShape obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CWaterShape(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public CWaterShape() {
    this(nel3dJNI.new_CWaterShape(), true);
  }

  public void serial(IStream f) {
    nel3dJNI.CWaterShape_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public CTransformShape createInstance(CScene scene) {
    long cPtr = nel3dJNI.CWaterShape_createInstance(swigCPtr, this, CScene.getCPtr(scene), scene);
    return (cPtr == 0) ? null : new CTransformShape(cPtr, false);
  }

  public boolean clip(SWIGTYPE_p_std__vectorT_NLMISC__CPlane_t pyramid, SWIGTYPE_p_NLMISC__CMatrix worldMatrix) {
    return nel3dJNI.CWaterShape_clip(swigCPtr, this, SWIGTYPE_p_std__vectorT_NLMISC__CPlane_t.getCPtr(pyramid), SWIGTYPE_p_NLMISC__CMatrix.getCPtr(worldMatrix));
  }

  public void render(IDriver arg0, CTransformShape arg1, boolean arg2) {
    nel3dJNI.CWaterShape_render(swigCPtr, this, IDriver.getCPtr(arg0), arg0, CTransformShape.getCPtr(arg1), arg1, arg2);
  }

  public void getAABBox(SWIGTYPE_p_NLMISC__CAABBox bbox) {
    nel3dJNI.CWaterShape_getAABBox(swigCPtr, this, SWIGTYPE_p_NLMISC__CAABBox.getCPtr(bbox));
  }

  public float getNumTriangles(float distance) {
    return nel3dJNI.CWaterShape_getNumTriangles(swigCPtr, this, distance);
  }

  public void flushTextures(IDriver driver, long selectedTexture) {
    nel3dJNI.CWaterShape_flushTextures(swigCPtr, this, IDriver.getCPtr(driver), driver, selectedTexture);
  }

  public void setWaterPoolID(long id) {
    nel3dJNI.CWaterShape_setWaterPoolID(swigCPtr, this, id);
  }

  public long getWaterPoolID() {
    return nel3dJNI.CWaterShape_getWaterPoolID(swigCPtr, this);
  }

  public static void setScreenGridSize(long x, long y) {
    nel3dJNI.CWaterShape_setScreenGridSize(x, y);
  }

  public static void setGridBorderSize(long x, long y) {
    nel3dJNI.CWaterShape_setGridBorderSize(x, y);
  }

  public static long getScreenXGridSize() {
    return nel3dJNI.CWaterShape_getScreenXGridSize();
  }

  public static long getScreenYGridSize() {
    return nel3dJNI.CWaterShape_getScreenYGridSize();
  }

  public static long getXGridBorder() {
    return nel3dJNI.CWaterShape_getXGridBorder();
  }

  public static long getYGridBorder() {
    return nel3dJNI.CWaterShape_getYGridBorder();
  }

  public void setShape(SWIGTYPE_p_NLMISC__CPolygon2D poly) {
    nel3dJNI.CWaterShape_setShape(swigCPtr, this, SWIGTYPE_p_NLMISC__CPolygon2D.getCPtr(poly));
  }

  public SWIGTYPE_p_NLMISC__CPolygon2D getShape() {
    return new SWIGTYPE_p_NLMISC__CPolygon2D(nel3dJNI.CWaterShape_getShape(swigCPtr, this), false);
  }

  public void getShapeInWorldSpace(SWIGTYPE_p_NLMISC__CPolygon poly) {
    nel3dJNI.CWaterShape_getShapeInWorldSpace__SWIG_0(swigCPtr, this, SWIGTYPE_p_NLMISC__CPolygon.getCPtr(poly));
  }

  public void getShapeInWorldSpace(SWIGTYPE_p_NLMISC__CPolygon poly, SWIGTYPE_p_NLMISC__CMatrix objMat) {
    nel3dJNI.CWaterShape_getShapeInWorldSpace__SWIG_1(swigCPtr, this, SWIGTYPE_p_NLMISC__CPolygon.getCPtr(poly), SWIGTYPE_p_NLMISC__CMatrix.getCPtr(objMat));
  }

  public void setWaveHeightFactor(float f) {
    nel3dJNI.CWaterShape_setWaveHeightFactor(swigCPtr, this, f);
  }

  public float getWaveHeightFactor() {
    return nel3dJNI.CWaterShape_getWaveHeightFactor(swigCPtr, this);
  }

  public void setEnvMap(long index, ITexture envMap) {
    nel3dJNI.CWaterShape_setEnvMap(swigCPtr, this, index, ITexture.getCPtr(envMap), envMap);
  }

  public ITexture getEnvMap(long index) {
    long cPtr = nel3dJNI.CWaterShape_getEnvMap__SWIG_0(swigCPtr, this, index);
    return (cPtr == 0) ? null : new ITexture(cPtr, false);
  }

  public void setHeightMap(long k, ITexture hm) {
    nel3dJNI.CWaterShape_setHeightMap(swigCPtr, this, k, ITexture.getCPtr(hm), hm);
  }

  public ITexture getHeightMap(long k) {
    long cPtr = nel3dJNI.CWaterShape_getHeightMap__SWIG_0(swigCPtr, this, k);
    return (cPtr == 0) ? null : new ITexture(cPtr, false);
  }

  public void setHeightMapScale(long k, SWIGTYPE_p_NLMISC__CVector2f scale) {
    nel3dJNI.CWaterShape_setHeightMapScale(swigCPtr, this, k, SWIGTYPE_p_NLMISC__CVector2f.getCPtr(scale));
  }

  public SWIGTYPE_p_NLMISC__CVector2f getHeightMapScale(long k) {
    return new SWIGTYPE_p_NLMISC__CVector2f(nel3dJNI.CWaterShape_getHeightMapScale(swigCPtr, this, k), true);
  }

  public void setHeightMapSpeed(long k, SWIGTYPE_p_NLMISC__CVector2f speed) {
    nel3dJNI.CWaterShape_setHeightMapSpeed(swigCPtr, this, k, SWIGTYPE_p_NLMISC__CVector2f.getCPtr(speed));
  }

  public SWIGTYPE_p_NLMISC__CVector2f getHeightMapSpeed(long k) {
    return new SWIGTYPE_p_NLMISC__CVector2f(nel3dJNI.CWaterShape_getHeightMapSpeed(swigCPtr, this, k), true);
  }

  public void setColorMap(ITexture map) {
    nel3dJNI.CWaterShape_setColorMap(swigCPtr, this, ITexture.getCPtr(map), map);
  }

  public ITexture getColorMap() {
    long cPtr = nel3dJNI.CWaterShape_getColorMap__SWIG_0(swigCPtr, this);
    return (cPtr == 0) ? null : new ITexture(cPtr, false);
  }

  public void setColorMapMat(SWIGTYPE_p_NLMISC__CVector2f column0, SWIGTYPE_p_NLMISC__CVector2f column1, SWIGTYPE_p_NLMISC__CVector2f pos) {
    nel3dJNI.CWaterShape_setColorMapMat(swigCPtr, this, SWIGTYPE_p_NLMISC__CVector2f.getCPtr(column0), SWIGTYPE_p_NLMISC__CVector2f.getCPtr(column1), SWIGTYPE_p_NLMISC__CVector2f.getCPtr(pos));
  }

  public void getColorMapMat(SWIGTYPE_p_NLMISC__CVector2f column0, SWIGTYPE_p_NLMISC__CVector2f column1, SWIGTYPE_p_NLMISC__CVector2f pos) {
    nel3dJNI.CWaterShape_getColorMapMat(swigCPtr, this, SWIGTYPE_p_NLMISC__CVector2f.getCPtr(column0), SWIGTYPE_p_NLMISC__CVector2f.getCPtr(column1), SWIGTYPE_p_NLMISC__CVector2f.getCPtr(pos));
  }

  public void setTransitionRatio(float percent) {
    nel3dJNI.CWaterShape_setTransitionRatio(swigCPtr, this, percent);
  }

  public float getTransitionRatio() {
    return nel3dJNI.CWaterShape_getTransitionRatio(swigCPtr, this);
  }

  public CTrackDefaultVector getDefaultPos() {
    long cPtr = nel3dJNI.CWaterShape_getDefaultPos(swigCPtr, this);
    return (cPtr == 0) ? null : new CTrackDefaultVector(cPtr, false);
  }

  public CTrackDefaultVector getDefaultScale() {
    long cPtr = nel3dJNI.CWaterShape_getDefaultScale(swigCPtr, this);
    return (cPtr == 0) ? null : new CTrackDefaultVector(cPtr, false);
  }

  public CTrackDefaultQuat getDefaultRotQuat() {
    long cPtr = nel3dJNI.CWaterShape_getDefaultRotQuat(swigCPtr, this);
    return (cPtr == 0) ? null : new CTrackDefaultQuat(cPtr, false);
  }

  public void enableLightMapping(boolean enable) {
    nel3dJNI.CWaterShape_enableLightMapping__SWIG_0(swigCPtr, this, enable);
  }

  public void enableLightMapping() {
    nel3dJNI.CWaterShape_enableLightMapping__SWIG_1(swigCPtr, this);
  }

  public boolean isLightMappingEnabled() {
    return nel3dJNI.CWaterShape_isLightMappingEnabled(swigCPtr, this);
  }

  public void enableSplash(boolean enable) {
    nel3dJNI.CWaterShape_enableSplash(swigCPtr, this, enable);
  }

  public boolean isSplashEnabled() {
    return nel3dJNI.CWaterShape_isSplashEnabled(swigCPtr, this);
  }

  public void setUseSceneWaterEnvMap(long index, boolean enable) {
    nel3dJNI.CWaterShape_setUseSceneWaterEnvMap(swigCPtr, this, index, enable);
  }

  public boolean getUseSceneWaterEnvMap(long index) {
    return nel3dJNI.CWaterShape_getUseSceneWaterEnvMap(swigCPtr, this, index);
  }

  public CRGBA computeEnvMapMeanColor() {
    return new CRGBA(nel3dJNI.CWaterShape_computeEnvMapMeanColor(swigCPtr, this), true);
  }

}
